<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class="app-container">
    <el-form id="mvcfm">
      <el-row>
        <el-col :span="25" :xs="24">
          <div class="form-unit">
            <span class="mvc-title-left"> 统计图 </span>
          </div>
          <el-table :data="s_procurement_task">
            <el-table-column label="操作" align="center" width='100' type=''>
              <template slot-scope="scope">
                <el-dropdown trigger="click">
                  <span class="el-dropdown-link">操作<i class="el-icon-arrow-down el-icon--right"></i></span>
                  <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item>
                      <el-link @click="gotoPage('&CMID='+scope.row.pm_task_id+''+vueparams+'')">分配任务</el-link>
                    </el-dropdown-item>
                    <el-dropdown-item>
                      <el-link @click="d_task('&CMIDpm_task_id='+scope.row.pm_task_id+'')">删除</el-link>
                    </el-dropdown-item>
                  </el-dropdown-menu>
                </el-dropdown>
              </template>
            </el-table-column>
            <el-table-column label="采购产品" prop="product_name">
            </el-table-column>
            <el-table-column label="产品型号" prop="product_model">
            </el-table-column>
            <el-table-column label="产品规格" prop="product_norm">
            </el-table-column>
            <el-table-column label="采购数量" prop="pm_task_no">
            </el-table-column>
            <el-table-column label="录入时间" prop="pm_task_entry_date">
              <template slot-scope="scope">
                {{getDateTimeString(scope.row,'pm_task_entry_date')}}
              </template>
            </el-table-column>
          </el-table>
          <pagination v-show="total>0" :total="total" :limit.sync="pageSize" @pagination="getPage" />
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'CartogramPurchase',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        s_procurement_task: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/supplychainmana/CartogramPurchase/cartogramPurchase?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      d_task(_params) {
        request({
          method: 'post',
          url: '/xcapi/VUEAction/psi/supplychainmana/CartogramPurchase/d_task?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.$router.replace("/redirect" + this.$route.fullPath);
          this.msgSuccess(data.msg);
        })
      },
    },
  }
</script>
